from machine import Pin

from neopixel import NeoPixel

import time



last_pin = None

last_led_num = None



def init(data_pin, leds_num):

    global np


    dp = Pin(data_pin, Pin.OUT)
    np = NeoPixel(dp, leds_num)






def shink_led(pin, leds_num, arr=[]):

    if pin!=last_pin and leds_num!= last_led_num:init(pin, leds_num)

    if len(arr) == 0:return

    for index,value in enumerate(arr):

        np[index] = value

    np.write()




